//
//  SDViewController.m
//  SDEditTagsLib
//
//  Created by sander.shan@yahoo.com on 07/29/2017.
//  Copyright (c) 2017 sander.shan@yahoo.com. All rights reserved.
//

#import "SDViewController.h"

#import <SDEditTagsLib/SDTagsView.h>

@interface SDViewController ()<SDTagsViewDelegate>

@property (nonatomic, weak) SDTagsView * editTagsView;


@end

@implementation SDViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self editTagsView];
    
//    [self.editTagsView addTags:@[@"我的爱",@"我的呜呜",@"我的道德",@"你的啊摔"]];
    
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)didAddTagString:(NSString *)tagString
{
    NSLog(@"add %@",tagString);
}


- (SDTagsView *)editTagsView
{
    if (!_editTagsView) {
        SDTagsView * theView = [[SDTagsView alloc] initWithFrame:CGRectMake(10, 100, 300, 46)];
        
        theView.backgroundColor = [UIColor yellowColor];
        theView.placeholder = @"这里输入什么呢";
        theView.can_delete_tag = NO;
        theView.numberLinesofTags = 0;
        [self.view addSubview:theView];
        theView.tagDelegate = self;
        _editTagsView = theView;
    }
    return _editTagsView;
}

@end
